package com.erju.dao;

import com.erju.pojo.SlLab;
import com.erju.pojo.SlLabAppointment;
import com.erju.pojo.VO.LabReviewVo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 实验室预约信息实体类
 */
@Repository
@Mapper
public interface LabAppointmentMapper {
    /***
     *教学预约-查询该实验室当天的预约信息
     * @Author erju
     * @Date 15:00 2022/3/26
     * @Param [slLab]
     * @return java.util.List<com.erju.pojo.SlLabAppointment>
     **/
    List<SlLabAppointment> teachSelectAppointmentByAppointment(SlLabAppointment slLabAppointment);

    /***
     *插入预约信息
     * @Author erju
     * @Date 18:18 2022/3/27
     * @Param [slLabAppointment]
     * @return java.lang.Boolean
     **/
    Boolean insertAppointment(SlLabAppointment slLabAppointment);

    /**
     * 实验室模糊查询预约信息预约状态
     */
    List<LabReviewVo> selectAppointmentByFlag(LabReviewVo labReviewVo);

    /**
     * 实验室批准审批
     * @param slLabAppointment
     * @return
     */
    Boolean updateAppointmentFlag(SlLabAppointment slLabAppointment);


    /***
     *删除实验室预约
     * @Author erju
     * @Date 11:53 2022/3/29
     * @Param [slLabAppointment]
     * @return java.lang.Boolean
     **/
    Boolean deleteLabAppointment(SlLabAppointment slLabAppointment);

    /**
     * 实验室预约信息查询实验室预约信息情况
     * @param slLabAppointment
     * @return
     */
    List<SlLabAppointment> selectAppointmentByAppointment(SlLabAppointment slLabAppointment);

    /**
     * 查询所有未过期的预约信息
     * @return
     */
    List<SlLabAppointment> selectNoOverdueAppointment();

    /**
     * 查询已经加入预约实验室的学生
     * @return
     */
    List<Integer> selectLabAppointmentStudent(Integer lab_appointment_id);
    /**
     * 删除已经加入预约实验室的学生
     * @return
     */
    Boolean deleteLabAppointmentStudent(Integer appointment_id);
    Boolean insertLabAppointmentStudent(Integer appointment_id,Integer student_id);
}
